<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script src="spellcheck_test.js"></script>
<script>
const clicked = false;

function handleClicked() {
    clicked = true;
}

spellcheck_test(
  '<input id="target" oncontextmenu="handleClicked()" type="search">',
  document => {
    assert_not_equals(window.eventSender, undefined, 'This test requires eventSender');

    var target = document.getElementById("target");
    var clickX = target.offsetLeft + target.offsetWidth - 2;
    var clickY = target.offsetTop + target.offsetHeight / 2;
    eventSender.mouseMoveTo(clickX, clickY);
    eventSender.contextClick();
  },
  '<input id="target" oncontextmenu="handleClicked()" type="search">',
  'Show context menu for search input should not crash.');
</script>
